package com.example.impl;



import com.example.config.AppContextUtil;
import com.example.config.ServiceImpl;
import com.example.demo.Student;
import org.quartz.*;
import org.springframework.context.ApplicationContext;

import java.util.List;



public class MyScheduledJob implements Job {
    private static ApplicationContext applicationContext;


    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {

//        ServiceImpl serviceImpl = (ServiceImpl) applicationContext.getBean("ServiceImpl");
//                Student student = serviceImpl.getStudent();
//        System.out.println(student);
        ServiceImpl serviceImpl = (ServiceImpl) AppContextUtil.getBean("ServiceImpl");
        Student student = serviceImpl.getStudent();
        System.out.println(student);

    }
}